﻿using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DeviceDebugger.ViewModel
{
    public class ViewModelLocator
    {
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.Register<RunWindowViewModel>();
            SimpleIoc.Default.Register<SettingWindowsViewModel>();
            SimpleIoc.Default.Register<IndexViewModel>();
            SimpleIoc.Default.Register<ProtocolViewModel>();
            SimpleIoc.Default.Register<StorageDisableViewModel>();
            SimpleIoc.Default.Register<MonitorViewModel>();
        }
        public RunWindowViewModel Main
        {
            get
            {
                return ServiceLocator.Current.GetInstance<RunWindowViewModel>();
            }
        }
        public SettingWindowsViewModel Setting
        {
            get
            {
                return ServiceLocator.Current.GetInstance<SettingWindowsViewModel>();
            }
        }
        public IndexViewModel Index
        {
            get
            {
                return ServiceLocator.Current.GetInstance<IndexViewModel>();
            }
        }
        public ProtocolViewModel Protocol
        {
            get
            {
                return ServiceLocator.Current.GetInstance<ProtocolViewModel>();
            }
        }
        public StorageDisableViewModel storagDisable
        {
            get
            {
                return ServiceLocator.Current.GetInstance<StorageDisableViewModel>();
            }
        }
        public MonitorViewModel Monitor
        {
            get
            {
                return ServiceLocator.Current.GetInstance<MonitorViewModel>();
            }
        }
    }
}
